<%- include('./layout/header.ejs') %>


<h1>文章列表</h1>

<div class="list-group" style="margin: 10px;">
  <% articles.forEach(item=>{%>
  <a href="/article/info/<%=item.id%>" class="list-group-item">
    <%=item.title%>
    <span class="badge" style="background-color: #5bc0de;">发表时间：
      <%=item.ctime%></span>
    <span class="badge" style="background-color: #f0ad4e;">作者昵称：
      <%=item.nickname%></span>
  </a>
  <%})%>
  <!-- <a href="/article/info/6" class="list-group-item">
    Node.js - day6（黑马博客案例）
    <span class="badge" style="background-color: #5bc0de;">发表时间：2018-07-17 15:13:30</span>
    <span class="badge" style="background-color: #f0ad4e;">作者昵称：泥巴巴</span>
  </a>

  <a href="/article/info/5" class="list-group-item">
    444
    <span class="badge" style="background-color: #5bc0de;">发表时间：2018-07-17 14:59:22</span>
    <span class="badge" style="background-color: #f0ad4e;">作者昵称：泥巴巴</span>
  </a> -->

</div>

<!-- 分页区域 -->
<nav aria-label="Page navigation">
  <ul class="pagination">
    <li class="disabled">
      <span href="?page=1" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
      </span>
    </li>
    <% for(var i=1;i<=totalpage;i++){%>
    <li class="<%=nowpage==i?'active':''%>">
      <a href="?page=<%=i%>">
        <%=i%></a></li>

    <% } %>
    <li class="">
      <a href="?page=2" aria-label="Next">
        <span aria-hidden="true">&raquo;</span>
      </a>
    </li>
  </ul>
</nav>



<%- include('./layout/footer.ejs') %>